<?php

include '../DB/dbConnection.php';

$result=array();

if ($_GET){
	
	$query="SELECT * FROM teachers WHERE id=".$_GET['id'];
	
	$stmt = $conn->prepare($query);
	$success = $stmt->execute();
	$stmt->bind_result($id,$empno,$name,$dob,$eployment_date,$position,$adhar,$gender,$maritial_status,$image,$cell_number,$landline,$email,$village,$city,$district,$state,$zip,$address,$degree,$certificate,$experience,$school_id);

	$tmp=array();
	
	while ($stmt->fetch())
	{
		$tmp['id']=$id;
		$tmp['empno']=$empno;
		$tmp['name']=$name;
		$tmp['dob']=$dob;
		$tmp['eployment_date']=$eployment_date;
		$tmp['position']=$position;
		$tmp['adhar']=$adhar;
		$tmp['gender']=$gender;
		$tmp['maritial_status']=$maritial_status;
		$tmp['image']=$image;
		$tmp['cell_number']=$cell_number;
		$tmp['landline']=$landline;
		$tmp['email']=$email;
		$tmp['village']=$village;
		$tmp['city']=$city;
		$tmp['district']=$district;
		$tmp['state']=$state;
		$tmp['zip']=$zip;
		$tmp['address']=$address;
		$tmp['degree']=$degree;
		$tmp['certificate']=$certificate;
		$tmp['experience']=$experience;
		$tmp['school_id']=$school_id;
	}

	$stmt->close();
	$conn->close();
		
	if($success)
	{
		$result['error']='false';
		$result['list']=$tmp;
	}
	else
		$result['error']='true';
}
else
{
	$result['error']='true';
}

echo json_encode($result);


?> 
